<template>
		<el-row style="margin: 20px;auto">
			<div class="div1">
				<span><i class="el-icon-notebook-2"></i> 更改个人信息</span>
				<hr>
				<table>
					<tr>
						<td>
							姓名
						</td>
						<td>
							<el-input type="text" v-model="user.name" placeholder="请输入姓名"/>
						</td>
					</tr>
					<tr>
						<td>
							手机号
						</td>
						<td>
							<el-input type="text" v-model="user.phone" placeholder="请输入手机号"/>
						</td>
					</tr>
					<tr>
						<td>
							地址
						</td>
						<td>
							<el-input type="textarea" v-model="user.addr"
							style="width: 580px;margin-left: 20px;" placeholder="请输入您的地址信息"></el-input>
						</td>
					</tr>
				</table>
				<br />
				<el-button type="primary" @click="UpdateAddr()">修改我的信息</el-button>
			</div>
		</el-row>
</template>

<script>
	export default {
		name: 'UpdatePwd',
		data() {
			return {
				user: {}
			}
		},
		methods: {
			UpdateAddr(){
				let k={
					nickname:this.user.name,
					phone:this.user.phone,
					addr:this.user.addr
				}
			    this.$postkv("/api/user/updateShip",k).then((resp)=>{
			        console.log(resp.data);
			        this.$message({
			            message: '地址信息更新成功!',
			            type:'success'
			        })
			    })
			}
		},
		mounted() {
			this.$get("/api/user/shipInfo").then((resp)=>{
			    this.user =resp.data.data;
			    console.log(resp.data.data);
			})
		}
	}
</script>

<style scoped>
.div1 span{
	margin-left: 25vw;
}
.div1 hr{
	border: 1px solid #409eff;
}
.div1 table{
	margin-left: 10vw;
	margin-top: 6vh;
}
.div1 table tr td .el-input{
	width: 580px;
	margin: 5px;
	margin-left: 20px;
}
.div1 .el-button{
	width: 280px;
	margin-left: 21vw;
	font-size: 16px;
}
</style>